package com.hjm.project.eagle.cashbackDetalis.controller;

import com.hjm.common.utils.poi.ExcelUtil;
import com.hjm.framework.aspectj.lang.annotation.Log;
import com.hjm.framework.aspectj.lang.enums.BusinessType;
import com.hjm.framework.web.controller.BaseController;
import com.hjm.framework.web.domain.AjaxResult;
import com.hjm.framework.web.page.TableDataInfo;
import com.hjm.project.eagle.cashbackDetalis.domain.EagleCashbackDetalis;
import com.hjm.project.eagle.cashbackDetalis.service.IEagleCashbackDetalisService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 雏鹰奖励列表,雏鹰计划明细Controller
 *
 * @author wyj
 * @date 2021-10-27
 */
@Controller
@RequestMapping("/eagle/eagleCashbackDetalis")
public class EagleCashbackDetalisController extends BaseController
{
    private String prefix = "eagle/eagleCashbackDetalis";

    @Autowired
    private IEagleCashbackDetalisService eagleCashbackDetalisService;

    /**
     *前往雏鹰奖励列表页面
     * @Param []
     * @Return java.lang.String
     */
    @RequiresPermissions("eagle:eagleCashbackDetalis:view")
    @GetMapping("/view")
    public String eagleCashbackDetalis()
    {
        EagleCashbackDetalis eagleCashbackDetalis = new EagleCashbackDetalis();
        List<EagleCashbackDetalis> list = eagleCashbackDetalisService.selectEagleCashbackDetalisList(eagleCashbackDetalis);
        return prefix + "/eagleCashbackDetalis";
    }


    /**
     * 获取雏鹰计划奖励列表信息
     */
    @RequiresPermissions("eagle:eagleCashbackDetalis:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo selectEagleInfoList(EagleCashbackDetalis eagleCashbackDetalis) {
        startPage();
        List<EagleCashbackDetalis> list = eagleCashbackDetalisService.selectEagleCashbackDetalisList(eagleCashbackDetalis);
        return getDataTable(list);
    }

    /**
     * 导出雏鹰计划报名记录信息
     */
    @RequiresPermissions("eagle:eagleCashbackDetalis:exportExcel")
    @Log(title = "雏鹰计划报名记录导出", businessType = BusinessType.EXPORT)
    @PostMapping("/exportExcel")
    @ResponseBody
    public AjaxResult exportExcel(EagleCashbackDetalis eagleCashbackDetalis)
    {
        List<EagleCashbackDetalis> list = eagleCashbackDetalisService.selectEagleCashbackDetalisList(eagleCashbackDetalis);
        ExcelUtil<EagleCashbackDetalis> util = new ExcelUtil<EagleCashbackDetalis>(EagleCashbackDetalis.class);
        return util.exportExcel(list, "雏鹰计划奖励记录");
    }
}
